/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = wtc_typed_xoctet.c                                 */
/*  NOTE      =                                                    */
/*  DATE      = 2015/08/26 by songbb                               */
/*******************************************************************/

#include "frreport_comm.h"
#include "conntrack.h"
#include "frct_comm.h"

#include "../wtc_core.h"
#include "../wtc_comm.h"
#include "../wtc_mar.h"
#include "wtc_typed_xoctet.h"

int wtc_typed_xoctet_tmpostrecv(Conntrack *p_st_conn
                                , L7session_wtc *p_st_sess
                                , L7_wtc_packet *p_st_wtc_packet
                                , int i_recv_size
                                , Frreport_body_data *p_st_body)
{
    WTC_PRINT_INFO("wtc_typed_xoctet_tmpostrecv...\n");
    char *p_array = NULL;

    if ((p_array = (char *) frmalloc(i_recv_size * sizeof(char))) == NULL)
    {
        WTC_MALLOCK_ERR;
        goto error;
    }

    if (bytebuff_get_bytes(p_st_wtc_packet->p_st_packet, p_array, (unsigned int) i_recv_size) != FR_SUCC)
        goto error;

    wtc_free((void **) &p_array);
    return FR_SUCC;
error:
    wtc_free((void **) &p_array);
    return FR_FAIL;
}

int wtc_typed_xoctet_tmpostrecv_fad(int i_recv_size
                                    , char *p_payload
                                    , unsigned int ui_payload_len
                                    , unsigned int *p_ui_offset)
{
    return wtc_skip(p_payload, ui_payload_len, p_ui_offset, i_recv_size);
}
